<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:th="http://www.thymeleaf.org"  
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"  
      layout:decorator="page">  
<body>  
<div th:fragment="pager">  
    <div class="text-right" ><!-- th:with="baseUrl=${httpServletRequest.getRequestURL().toString()},pars=${httpServletRequest.getQueryString() eq null ? '' : new String(httpServletRequest.getQueryString().getBytes('iso8859-1'), 'UTF-8')}" --> 
        <ul style="margin:0px;" class="pagination" > <!-- th:with="newPar=${new Java.lang.String(pars eq null ? '' : pars).replace('page='+(page.number), '')},  
                                                curTmpUrl=${baseUrl+'?'+newPar},  
                                                curUrl=${curTmpUrl.endsWith('&amp;') ? curTmpUrl.substring(0, curTmpUrl.length()-1):curTmpUrl}" -->
            <!--<li th:text="${pars}"></li>-->  
  
            <li><a href="${url}" th:href="${url}" th:text="首页"></a></li>  
            <li th:if="${page.hasPrevious()}"><a href="${url}" th:href="${url+'?page='+(page.number-1)}">上一页</a></li>  
  
            <!--总页数小于等于10-->  
            <div th:if="${(page.totalPages le 10) and (page.totalPages gt 0)}" th:remove="tag">  
                <div th:each="pg : ${#numbers.sequence(0, page.totalPages - 1)}" th:remove="tag">  
                        <span th:if="${pg eq page.number}" th:remove="tag">  
                            <li class="active"><span class="current_page line_height" th:text="${pg+1}">${pageNumber}</span></li>  
                        </span>  
                    <span th:unless="${pg eq page.number}" th:remove="tag">  
                            <li><a href="${url}" th:href="${url+'?page='+ pg}" th:text="${pg+1}"></a></li>  
                        </span>  
                </div>  
            </div>  
  
            <!-- 总数数大于10时 -->  
            <div th:if="${page.totalPages gt 10}" th:remove="tag">  
                <li th:if="${page.number-2 ge 0}"><a href="${url}" th:href="${url+'?page='+(page.number-2)}" th:text="${page.number-1}"></a></li>  
                <li th:if="${page.number-1 ge 0}"><a href="${url}" th:href="${url+'?page='+(page.number-1)}" th:text="${page.number}"></a></li>  
                <li class="active"><span class="current_page line_height" th:text="${page.number+1}"></span></li>  
                <li th:if="${page.number+1 lt page.totalPages}"><a href="${url}" th:href="${url+'?page='+(page.number+1)}" th:text="${page.number+2}"></a></li>  
                <li th:if="${page.number+2 lt page.totalPages}"><a href="${url}" th:href="${url+'?page='+(page.number+2)}" th:text="${page.number+3}"></a></li>  
            </div>  
  
  
            <li th:if="${page.hasNext()}"><a href="${url}" th:href="${url+'?page='+(page.number+1)}">下一页</a></li>  
            <!--<li><a href="task/list/" th:href="task/list/(page=${page.totalPages-1})}">尾页</a></li>-->  
            <li><a href="${url}" th:href="${url+'?'+((page.totalPages le 0 )?'':'page='+(page.totalPages-1))}">尾页</a></li>   
            <li><span th:utext="'第'+${page.number+1}+'页 / 共'+${page.totalPages}+'页    共'+${page.totalElements}+' 条'"></span></li>  
        </ul>  
    </div>  
</div>  
</body>  
</html>